package com.bukkit.kazimir.TeamGames;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;

import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class TeamGames extends JavaPlugin {

	private final TeamsPlayerListener playerListener = new TeamsPlayerListener(
			this);
	private final TeamsBlockListener blockListener = new TeamsBlockListener(
			this);


	public TeamGames(PluginLoader pluginLoader, Server instance,
			PluginDescriptionFile desc, File folder, File plugin,
			ClassLoader cLoader) {
		super(pluginLoader, instance, desc, folder, plugin, cLoader);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onDisable() {
		// TODO Auto-generated method stub

	}

	@Override
	// When the plugin is enabled this method is called.
	public void onEnable() {
		// Create the pluginmanage pm.
		PluginManager pm = getServer().getPluginManager();
		// Create PlayerCommand listener
		pm.registerEvent(Event.Type.PLAYER_COMMAND, this.playerListener,
				Event.Priority.Normal, this);
		// Create BlockPlaced listener
		pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener,
				Event.Priority.Normal, this);
		// Get the infomation from the yml file.
		PluginDescriptionFile pdfFile = this.getDescription();
		// Print that the plugin has been enabled!
		System.out.println(pdfFile.getName() + " version "
				+ pdfFile.getVersion() + " is enabled!");
	}


}
